From 7ecf1527ed5245f48598daed5ad4c1243f0a88bc Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Sun, 13 Nov 2022 01:42:41 +0100
Subject: [PATCH] use turnstile's path for lingering

---
 src/login/logind-dbus.c | 6 +++---
 src/login/logind-user.c | 2 +-
 src/login/logind.c      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index a9c954c..7f27c0b 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1291,8 +1291,8 @@ static int method_set_user_linger(sd_bus_message *message, void *userdata, sd_bu
         if (r == 0)
                 return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
 
-        (void) mkdir_p_label("/var/lib/elogind", 0755);
-        r = mkdir_safe_label("/var/lib/elogind/linger", 0755, 0, 0, MKDIR_WARN_MODE);
+        (void) mkdir_p_label("/var/lib/turnstiled", 0755);
+        r = mkdir_safe_label("/var/lib/turnstiled/linger", 0755, 0, 0, MKDIR_WARN_MODE);
         if (r < 0)
                 return r;
 
@@ -1300,7 +1300,7 @@ static int method_set_user_linger(sd_bus_message *message, void *userdata, sd_bu
         if (!cc)
                 return -ENOMEM;
 
-        path = strjoina("/var/lib/elogind/linger/", cc);
+        path = strjoina("/var/lib/turnstiled/linger/", cc);
         if (b) {
                 User *u;
 
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index d4d390d..2b3331f 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -653,7 +653,7 @@ int user_check_linger_file(User *u) {
         if (!cc)
                 return -ENOMEM;
 
-        p = strjoina("/var/lib/elogind/linger/", cc);
+        p = strjoina("/var/lib/turnstiled/linger/", cc);
         if (access(p, F_OK) < 0) {
                 if (errno != ENOENT)
                         return -errno;
diff --git a/src/login/logind.c b/src/login/logind.c
index 1fa58aa..927f13d 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -316,12 +316,12 @@ static int manager_enumerate_linger_users(Manager *m) {
 
         assert(m);
 
-        d = opendir("/var/lib/elogind/linger");
+        d = opendir("/var/lib/turnstiled/linger");
         if (!d) {
                 if (errno == ENOENT)
                         return 0;
 
-                return log_error_errno(errno, "Failed to open /var/lib/elogind/linger/: %m");
+                return log_error_errno(errno, "Failed to open /var/lib/turnstiled/linger/: %m");
         }
 
         FOREACH_DIRENT(de, d, return -errno) {
-- 
2.38.1

